package com.jams.goodox.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.TextView;

/**
 * Created by Jin on 2016/7/27.
 * Description
 */
public class ItemNumTextView extends TextView {

	public ItemNumTextView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@Override
	public void setText(CharSequence text, BufferType type) {
		if (null != text && !text.toString().equalsIgnoreCase("") && !text.toString().equalsIgnoreCase("...")) {
			if (Integer.parseInt(text.toString()) == 0) {
				setVisibility(GONE);
			} else {
				setVisibility(VISIBLE);
			}
		}
		super.setText(text, BufferType.NORMAL);
	}
}
